@import './_variables.scss';

/**
 * @description: 盒子最大最小统一宽度
 */ 
@mixin containerBox ($widtth: 100%, $paddDis: $System__bothSides_padding) {
  width: $widtth;
  padding: $paddDis;
  margin: 0 auto;
}

/**
 * @description: 线性渐变
 */
@mixin Theme__linear ($left: 'transparent', $right: 'transparent', $to: right) {
  background-image: linear-gradient(to $to, $left, $right);
}
/**
 * @description: 伪类选中
 */
 @mixin activeAfter ($width:10upx, $height: 10upx, $bgset: $Theme__color) {
  content: '';
  display: inline-block;
  width: $width;
  height: $height;
  background-color: $bgset;
}
/**
 * @description: 定位垂直水平居中
 */
@mixin positionCenter ($x: 50%, $y: 50%) {
  position: absolute;
  left: $x;
  top: $y;
  transform: translate(-$x,-$y);
}
/**
 * @description: 定位垂直居中
 */
@mixin positionVerticalCenter ($y: 50%) {
  position: absolute;
  top: $y;
  transform: translateY(-$y);
}
/**
 * @description: flexBox垂直居中
 */
@mixin flexBoxVerticalCenter($jusCont: space-between, $aliItem: center) {
  display: flex;
  align-items: $aliItem;
  justify-content: $jusCont;
}
/**
 * @description: 文字超出省略号
 */
 @mixin textOverFlow($clamp: 1) {
  @if $clamp == 1 {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: $clamp;
    -webkit-box-orient: vertical;
    line-clamp: $clamp;
  }
  @if $clamp > 1 {
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: $clamp;
    line-clamp: $clamp;
    -webkit-box-orient: vertical;
  }
}
/**
 * @description: 用户选择复制文本
 */
@mixin userSelectTxt() {
	cursor: auto;
	user-select: text;
	-webkit-user-select: text;
}